| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | "use strict"; |
||
| 10 | module.exports = response => { |
||
| 11 | const format = object => { |
||
| 12 | if (object instanceof Response) { |
||
| 13 | return { |
||
| 14 | body: object.getBody(), |
||
| 15 | statusCode: object.getStatusCode(), |
||
| 16 | headers: object.getHeaders() |
||
| 17 | }; |
||
| 18 | } |
||
| 19 | |||
| 20 | return object; |
||
| 21 | }; |
||
| 22 | |||
| 23 | if (Array.isArray(response)) { |
||
| 24 | return response.map(format); |
||
| 25 | } |
||
| 26 | |||
| 27 | return format(response); |
||
| 28 | }; |
||
| 29 |